{% extends 'app_base.html' %}
{% load i18n %}

{% block head %}
  <link href="{{ STATIC_URL }}css/feeds.css" rel="stylesheet">
  <script src="{{ STATIC_URL }}js/jquery.bullseye-1.0-min.js"></script>
  <script src="{{ STATIC_URL }}js/feeds.js"></script>
  <script src="{{ STATIC_URL }}js/mui.min.js"></script>
  <meta name="viewport" content="user-scalable=no"/>
{% endblock head %}

{% block main %}
  <div class="page-header">
    <button type="button" class="btn btn-primary pull-right btn-compose" title="{% trans 'Press Ctrl + P to compose' %}">
      <span class="glyphicon glyphicon-share-alt"></span> 发布
    </button>
    <h1>宁强圈</h1>
  </div>
    <div class="compose">
    <h2>{% trans "Compose a new post" %}</h2>
    <form role="form" id="compose-form">
      {% csrf_token %}
      <input type="hidden" name="last_feed">
      <div class="form-group">
        <textarea class="form-control" rows="3" name="post"></textarea>
      </div>
      <div style="margin-bottom:10px">
      {% for item in cg_list %}
      <label class="radio-inline">
        <input type="radio" name="category" id="category" value={{ item.0 }}{% if active == item.0 %} checked{% endif %}>{{ item.1 }}
      </label> 
      {% endfor %}
      </div>
      <div class="form-group">
        <button type="button" class="btn btn-primary btn-post">
          <span class="glyphicon glyphicon-send"></span> {% trans 'Post' %}
        </button>
        <button type="button" class="btn btn-default btn-cancel-compose">{% trans 'Cancel' %}</button>
        <span class="help-block help-count pull-right">255</span>
      </div>
    </form>
    </div>
    <div class="stream-update">
      <a href="#"><span class="new-posts"></span> {% trans 'new posts' %}</a>
    </div>
  <div class="row results" style="margin-top: 15px">
    <div class="col-md-12">
    <ul class="stream">
      {% for feed in feeds %}
        {% include 'feeds/partial_feed.html' with feed=feed %}
      {% endfor %}
    </ul>
    <div class="load">
      <img src="{{ STATIC_URL }}img/loading.gif">
    </div>
    <form method="get" action="{% url 'load' %}" id="load_feed" autocomplete="off">
      <input type="hidden" name="feed_source" id="feed_source" value="all">
      <input type="hidden" name="from_feed" value="{{ from_feed }}">
      <input type="hidden" name="page" value="{{ page }}">
      <input type="hidden" name="active" id="active" value="{{ active }}">
    </form>
    </div>
  </div>
{% endblock main %}
{% block script %}
  <script>
   // $(document).ready(function() {
   //     $("a").each(function(){
   //         this.attr("href", "");
   //     });
   // });
    mui.init();
  </script>
{% endblock script %}
